package com.chenfan.mcn.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 结算方式枚举
 *
 * @author wulg
 * @date 2022-01-14
 **/
@SuppressWarnings("AlibabaEnumConstantsMustHaveComment")
@Getter
@AllArgsConstructor
public enum SettlementMethodEnum {

    SINGLE_REMITTANCE("singleRemittance", "单笔打款"),

    SINGLE_RECEIVE_PAYMENT("singleReceivePayment", "对私收款"),

    BATCH_REMITTANCE("batchRemittance", "批量打款"),

    BATCH_RECEIVE_PAYMENT("batchReceivePayment", "对公收款"),

    ;

    private final String code;

    private final String name;

    /**
     * 是否是单笔打款
     * @param settlementMethod
     * @return
     */
    public static boolean isSingleRemittance(String settlementMethod) {
        return SettlementMethodEnum.SINGLE_REMITTANCE.code.equalsIgnoreCase(settlementMethod);
    }

    /**
     * 是否是收款
     * @param settlementMethod
     * @return
     */
    public static boolean isReceivePayment(String settlementMethod) {
        return SettlementMethodEnum.SINGLE_RECEIVE_PAYMENT.code.equalsIgnoreCase(settlementMethod)
                || SettlementMethodEnum.BATCH_RECEIVE_PAYMENT.code.equalsIgnoreCase(settlementMethod);
    }

    /**
     * 是否是打款
     * @param settlementMethod
     * @return
     */
    public static boolean isRemittance(String settlementMethod) {
        return SettlementMethodEnum.SINGLE_REMITTANCE.code.equalsIgnoreCase(settlementMethod)
                || SettlementMethodEnum.BATCH_REMITTANCE.code.equalsIgnoreCase(settlementMethod);
    }
}
